<#include "/common/head.ftl">

<#macro monthNames number>
	<#assign names = ["", "January", "February", "March", "April", 
							"May", "June", "July", "August", 
							"September", "October", "November", "December"]>
	${names[number]}
</#macro>

<@showTitle title="${i18n.getMessage('configuration')}">
</@showTitle>

<br/>

<form id="form1" name="form1">
	<strong>${i18n.getMessage('month')} / ${i18n.getMessage('year')}: </strong>
	<select name="month" id="month" onchange="cc('system/updateListCurrency.sgt?month=' + this.value + '&year=' + $('year').value)">
       	<#list 1..12 as lmonth>
       		<option value="${lmonth}" <#if lmonth == month>selected="selected"</#if>><@monthNames lmonth></@monthNames></option>	
       	</#list>
    </select>
    /
    <select name="year" id="year" onchange="cc('system/updateListCurrency.sgt?month=' + $('month').value + '&year=' + this.value)">
       	<#list yearArr as lyear>
       		<option value="${lyear}" <#if lyear == year>selected="selected"</#if>>${lyear}</option>	
       	</#list>
    </select>
    <a href="javascript:exportExcel(${usds?size})" class="export-icon">${i18n.getMessage('export.excel')}</a>
</form>
<br/>
<#if (usds?size > 0)>
<@display.table id="listTable" name="usds" sort="list" defaultsort="1" style="width: 400px;">
<@display.column class="center" title="${i18n.getMessage('date')}">${(listTable.date)!}</@display.column>
<@display.column class="center" title="${i18n.getMessage('Vietcombank')}">${(listTable.amount?string('#,#00'))!}</@display.column>
</@display.table>
<#else>
	<p class="info">${i18n.getMessage('record.notfound')}</p>
</#if>
<br/><br/>

<script language="javascript" type="text/javascript">
exportExcel = function(size) {
	if (size <= 0) {
		alert("No records to export!");
	}
	else {
		window.open("system/exportExcel.sgt?month=" + $("month").value + 
			"&year=" + $("year").value);
	}
}
</script>